package com.wondersgroup.simple.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.wondersgroup.simple.consumer.entity.User;

@RestController
public class ConsumerController {
	
	@Autowired
	private RestTemplate restTemplate;

	@GetMapping("/consumer/{id}")
	public User findById(@PathVariable Long id){
		return restTemplate.getForObject("http://localhost:7090/provice/"+id, User.class);
		
	}
	
}
